// 	Name: 12.c
//	Description: Chapter 6 project 12
//	Author: StableGenius
//	Date: 2020-07-09
//	Email: feng@dongfa.pro

#include <stdio.h>
#include <stdbool.h>

int main(void) {
	float result = 1.0f, e;
	int i = 1, factorial = 1;

	printf("Enter your epsilon: ");
	scanf("%f", &e);

	while (true) {
		if (1.0f / factorial < e) break;

		result += 1.0f / factorial;
		factorial *= (i++ + 1);
	}

	printf("e = %f\n", result);

	return 0;
}
